SEVEN SEGMENT DISPLAY INTERFACING WITH NODEMCU
In this experiment, we are going to interface Seven segment display with NodeMCU which has ESP8266 microcontroller. There are total 9 buttons in seven-segment display and each button is assigned a number from 1 to 9. Pressing any button will display its corresponding number on the 7-segment display. seven-segment LED operates on two modes common anode and common cathode. In this project, we have chosen common anode mode. NodeMCU acts as a server and our mobile/laptop act as a client.
Synopsis

In this experiment, we are going to interface Seven segment display with NodeMCU which has ESP8266 microcontroller. There are total 9 buttons in seven-segment display and each button is assigned a number from 1 to 9. Pressing any button will display its corresponding number on the 7-segment display. seven-segment LED operates on two modes common anode and common cathode. In this project, we have chosen common anode mode. NodeMCU acts as a server and our mobile/laptop act as a client.

Description


Seven Segment display

1. There are 8 LED present in seven-segment display named as (a, b, c, d, e, f, g)

2. Low power consumption compared to LCD

3.Better, contrast, and larger display than conventional LCD displays.

4. Current consumption: 30mA / segment

5. Peak current: 70mA

6.Seven segment display will operate on 3.3 volts to +5 volts. In this project, we are operating on 3.3V.


NodeMCU

A NodeMCU is a development board with an inbuilt Wi-Fi module in it. It is a basic and cheapest board to carry our projects using internet of things. The NodeMCU has ESP8266 microcontroller unit in it. The operation of this microcontroller is controlled with the programs used in Arduino thus making it very easier to use and also to learn basic IoT projects. This board has inbuilt 2.4GHz antenna to receive Wi-Fi functions. This board has a memory of 4MB to store the data acting as ROM and 64Kb of RAM. This board operates at 3.3 volts and 5v and it is mandatory to operate the board at these voltage levels and if voltage is more than that it will board may damage few GPIO pins (general input-output pins).


Pin Configuration

1. Vin: 3.3V can be provided at this pin as the supply to power on the board. This pin is used to power on the entire microcontroller.

2. GND: This pin is connected to the negative terminal of the battery.

3. RST: This pin resets the microcontroller and clears the memory.

4. EN: This pin is used to enable the operation of microcontroller.

5. 3V3: This pin provides 3V output and this can be used to power up some sensor units connected to the microcontroller.

6. SD1, CMD, SD0, CLK: These pins are used in SPI communication, that is it is used to transfer the signals between two microcontrollers, Rx and Tx modules with asynchronous transmission.

7. SD3, SD2: These pins can also function as asynchronous transmission or as GPIO pins.

8. RSV: These are two reserved pins used by the microcontroller and cannot be used in connecting any external circuits to it.

9. A0: This microcontroller only has one analog pin for Analog communication. This A0 pin is used in analog signal communication.

10. GPIO 1 – 16: This controller board has 16 input-output pins which be used as input or output pin based on the programming.

11. GP10 1, 3, 13, 15: This microcontroller has 2 UART communication pins, RX0, TX0 (GPIO 1 & GPIO 3) and RX1, TX1 (GPIO 13, GPIO15).

Seven segment and NodeMCU pin connections

• NodeMCU GPIO-0 is connected to Pin ‘a’ of 7 segment display.

• NodeMCU GPIO-1 is connected to Pin ‘b’ of 7 segment display.

• NodeMCU GPIO-2 is connected to Pin ‘c’ of 7 segment display.

• NodeMCU GPIO-3 is connected to Pin ‘d’ of 7 segment display.

• NodeMCU GPIO-4 is connected to Pin ‘e’ of 7 segment display.

• NodeMCU GPIO-5 is connected to Pin ‘f’ of 7 segment display.

• NodeMCU GPIO-16 is connected to Pin ‘g’ of 7 segment display.

• And common from 7 segment display is connected to 3.3v pin NodeMCU.

Schematic


Code

const int A = D1;
const int B = D2;
const int C = D3;
const int D = D4;
const int E = D5;
const int F = D6;
const int G = D7;
const int DP = D8;

void setup() {                
  pinMode(A, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(C, OUTPUT);
  pinMode(D, OUTPUT);
  pinMode(E, OUTPUT);
  pinMode(F, OUTPUT);
  pinMode(G, OUTPUT);
  pinMode(DP, OUTPUT);  
}

void loop() {
  ZERO();
  delay(1000);              
  ONE();
  delay(1000);           
  THREE();
  delay(1000);           
  FOUR();
  delay(1000);           
  FIVE();
  delay(1000);           
  SIX();
  delay(1000);           
  SEVEN();
  delay(1000);
  EIGHT();
  delay(1000);           
  NINE();
  delay(1000);                        
}

void ZERO(){
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, HIGH);
  digitalWrite(DP, HIGH);
  }
void ONE(){
  digitalWrite(A, HIGH);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, HIGH);
  digitalWrite(E, HIGH);
  digitalWrite(F, HIGH);
  digitalWrite(G, HIGH);
  digitalWrite(DP, HIGH);
  }
void TWO(){
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, HIGH);
  digitalWrite(D, LOW);
  digitalWrite(E, LOW);
  digitalWrite(F, HIGH);
  digitalWrite(G, LOW);
  digitalWrite(DP, HIGH);  
}
void THREE(){
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, HIGH);
  digitalWrite(G, LOW);
  digitalWrite(DP, HIGH);
  }
void FOUR(){
  digitalWrite(A, HIGH);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(DP, HIGH);
  }
void FIVE(){
  digitalWrite(A, LOW);
  digitalWrite(B, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(DP, HIGH);  
}
void SIX(){
  digitalWrite(A, LOW);
  digitalWrite(B, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(DP, HIGH);
  }
void SEVEN(){
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, HIGH);
  digitalWrite(E, HIGH);
  digitalWrite(F, HIGH);
  digitalWrite(G, HIGH);
  digitalWrite(DP, HIGH);
  }
void EIGHT(){
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(DP, HIGH);
  }
void NINE(){
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(DP, HIGH);
  }

Error message here!

Show Error message here!


Forgot your password?

Error message here!

Send OTP

Error message here!

Show Error message here!


Lost your password? Please enter your email address. You will receive a password you Need.

Send Error message here!


Back to log-in

Close